﻿Imports System.Collections.Generic
Imports System.Data.SqlClient
Namespace QuanLyKhachHang
    Public Class TinhThanhDAL
        Public Function TinhThanh_GetItems() As List(Of TinhThanh)
            Try
                Dim SQLHelper As New SQLDataHelper
                Dim Reader As SqlDataReader
                Reader = SQLHelper.ExecuteReader("sp_TinhThanh_GetItems", CommandType.StoredProcedure)
                Dim item As TinhThanh
                Dim list As New List(Of TinhThanh)
                While (Reader.Read())
                    item = New TinhThanh
                    item.TinhThanhId = Integer.Parse(Reader("TinhThanhId").ToString())
                    item.MaTinhThanh = Reader("MaTinhThanh").ToString()
                    item.TenTinhThanh = Reader("TenTinhThanh").ToString()
                    list.Add(item)
                End While
                Return list
            Catch ex As Exception
                Throw ex
            End Try
        End Function
    End Class
End Namespace
